package myTeam.timeShop.bean;

// Generated 2016-3-28 15:20:15 by Hibernate Tools 3.2.2.GA

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;
@NamedQueries({
	@NamedQuery(name="getAllMyNoSeeLike",query="from TbLike i where i.tbDemand.tbUserByDemandUserId.userId= ? and i.likeIsSaw=0")
	
})
/**
 * Entity: 
 */
@Entity
@Table(name = "tb_like", catalog = "db_timeshop")
public class TbLike implements java.io.Serializable {

	/** 
	 * ���ޱ�id.
	 */

	private Integer likeId;

	/** 
	 * �����û�id.
	 */

	private TbUser tbUser;

	/** 
	 * ����id.
	 */

	private TbDemand tbDemand;

	/** 
	 * ����ʱ��.
	 */

	private Date likeTime;

	/** 
	 * ɾ��״̬.
	 */

	private Integer likeDeleteStatus;

	/** 
	 * �Ķ�״̬.
	 */

	private Integer likeIsSaw;

	public TbLike() {
	}

	public TbLike(TbUser tbUser, TbDemand tbDemand, Date likeTime,
			Integer likeDeleteStatus, Integer likeIsSaw) {
		setTbUser(tbUser);
		setTbDemand(tbDemand);
		setLikeTime(likeTime);
		setLikeDeleteStatus(likeDeleteStatus);
		setLikeIsSaw(likeIsSaw);
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "like_id", unique = true, nullable = false)
	public Integer getLikeId() {
		return this.likeId;
	}

	public void setLikeId(Integer likeId) {
		this.likeId = likeId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "like_user_id")
	public TbUser getTbUser() {
		return this.tbUser;
	}

	public void setTbUser(TbUser tbUser) {
		this.tbUser = tbUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "like_demand_id")
	public TbDemand getTbDemand() {
		return this.tbDemand;
	}

	public void setTbDemand(TbDemand tbDemand) {
		this.tbDemand = tbDemand;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "like_time", length = 19)
	public Date getLikeTime() {
		return this.likeTime;
	}

	public void setLikeTime(Date likeTime) {
		this.likeTime = likeTime;
	}

	@Column(name = "like_delete_status")
	public Integer getLikeDeleteStatus() {
		return this.likeDeleteStatus;
	}

	public void setLikeDeleteStatus(Integer likeDeleteStatus) {
		this.likeDeleteStatus = likeDeleteStatus;
	}

	@Column(name = "like_is_saw")
	public Integer getLikeIsSaw() {
		return this.likeIsSaw;
	}

	public void setLikeIsSaw(Integer likeIsSaw) {
		this.likeIsSaw = likeIsSaw;
	}

}
